
# Compiler and Linker
CC = gcc
MPICC = mpicc 
MPIFC = mpif90
LD = $(MPIFC)

# Optimization specs for compiler - used for FESOM an parms.
# Metis falls back to conservative and non-compiler specific -O2, as
# it is only used in the less runtime-critical setup phase. 
OPT  = -O3 -r8 -fp-model precise -xHost -ip -implicitnone # -g -traceback -check all -check noarg_temp_created
COPT = -O3 -xHost -DLINUX -DUNDER_ -DMPI2 -Iinclude

# NetCDF library and include definitions
NCFDIR   = /global/AWIsoft/netcdf/4.6.1_intel_18.0.3
NC_LIB   = -L$(NCFDIR)/lib -Wl,-rpath,$(NCFDIR)/lib -lnetcdff
NC_INC   = -I$(NCFDIR)/include

# Definitions for MPI, if not set by compiler wrappers
MPIROOT = 
MPI_LIB = 
MPI_INC = 

# Definition of BLAS and LAPACK include and library 
LIB_LAP = -mkl=sequential -static-intel


## For partitioning, the FESOM initialization offers an interface to Metis 5. 
## The option -DPART_WEIGHTED distributes 2D _and_ 3D-nodes equally, but the 
## partitioning might be quite irregular.
## Without DPART_WEIGHTED, only the number of 2D nodes is considered for load balancing.
## You can start Metis 5 with different random seeds -> different partitions. 

METIS_DEFS = -DMETIS_VERSION=5 -DPART_WEIGHTED -DMETISRANDOMSEED=35243
# METISRANDDOMSEED: any integer

# Used to compile the fesom wrapper to parms
PARMS_DEFS = -DUSE_MPI -DREAL=double -DDBL  -DVOID_POINTER_SIZE_8

######################################################
#
# Preprocessor
CPP = /usr/bin/cpp -P -C

######################################################
# Preprocessor definition

CPP_DEFS= 

#######################################################
# for pARMS and metis Library, archive and options

AR     = ar qv
RANLIB = ranlib
